Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

errors: add a benchmark comparing stack trace performance #74

Merged
merged 1 commit into from
Jul 24, 2016
Merged

errors: add a benchmark comparing stack trace performance #74

merged 1 commit into from
Jul 24, 2016

Conversation

kardianos
Copy link
Contributor

@kardianos kardianos commented Jul 23, 2016

Cost is roughly 1600 ns to 6000 ns depending on the stack size. Adds two additional allocations.

BenchmarkErrors/pkg/errors-stack-10-4 1000000 1676 ns/op 320 B/op 3 allocs/op
BenchmarkErrors/errors-stack-10-4 20000000 64.9 ns/op 16 B/op 1 allocs/op
BenchmarkErrors/pkg/errors-stack-100-4 500000 3058 ns/op 320 B/op 3 allocs/op
BenchmarkErrors/errors-stack-100-4 3000000 472 ns/op 16 B/op 1 allocs/op
BenchmarkErrors/pkg/errors-stack-1000-4 200000 10685 ns/op 320 B/op 3 allocs/op
BenchmarkErrors/errors-stack-1000-4 300000 4523 ns/op 16 B/op 1 allocs/op

Fixes #72

@davecheney
Copy link
Member

Nice use of the new sub benchmark feature. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants